<?xml version="1.0" encoding="utf-8" ?>
[#include "/WEB-INF/pages/common/taglibs.ftl"]
[@c.url var="backUrl" value='/manage/Role_list.action' scope="page"]
[/@c.url]
[#macro _script]
	<link rel="stylesheet" href="[@c.url value='/js/plugins/jquery-ztree/css/zTreeStyle/zTreeStyle.css'/]" type="text/css">
	<script type="text/javascript" src="[@c.url value='/js/plugins/jquery-ztree/js/jquery.ztree.core-3.1.js'/]"></script>
	<script type="text/javascript" src="[@c.url value='/js/plugins/jquery-ztree/js/jquery.ztree.excheck-3.1.min.js'/]"></script>
	<script type="text/javascript" src="[@c.url value='/js/plugins/jquery.alerts.js'/]"></script>
	<script type="text/javascript" src="[@c.url value='/js/plugins/jquery.form.js'/]"></script>
	<script type="text/javascript">
		var base = (function(){
			// 事件绑定
			function _addEventListeners() {
        		$('#roleSubmit').click(function(){
        			var form = $('#roleFunctionForm');
        			form.submit();
        			return false;
        		})
			}
			return {
                config: {
                	url : null,
                    theme: null
                },
                init: function () {
                	_addEventListeners();
                }
			}
		}());
		
		$(function(){
			var link = "[@c.url value='/manage/Role_list.action?currentPage=${currentPage}' /]";
			base.config.theme = getTheme();
			base.config.url = link;
            //Initializing the form
			base.init();
		})
	</script>
[/#macro]
[#if piece==true]
	[@_script /]
	<!--设置提交行为-->
	[#assign act="save" /]
	<!--设置table渲染到指定ID节点-->
	[#include "/WEB-INF/pages/manage/Role/_roleList.ftl"]
[#else]
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Insert title here</title>
		<meta name="menu" content="AdminMenu"/>
		<meta name="heading" content="heading"/>
		[@_script /]
	</head>
	<body id="body">
        <div class="contenttitle radiusbottom0">
        	<h2 id="vertical" class="form"><span>角色功能管理</span></h2>
        </div><!--contenttitle-->
        [#assign act="save" /]
        [#assign renderTo="#roleList"]
		<div class="stepContainer" >
			<div class="tableoptions">
				<a href="[@c.url value='/manage/Role_create.action'/]" class="radius3"><span>新&nbsp;&nbsp;&nbsp;&nbsp;建</span></a>
        		<button tableid='roleListTable' title="删除所选" class="deletebutton radius3">删除所选</button> &nbsp;
			</div>
			<div id="roleList">
				[#include "/WEB-INF/pages/manage/Role/_roleList.ftl"]
			</div>
		</div>
        <form id="rmRoles" action="[@c.url value='/manage/Role_rm.action'][@c.param name="backUrl" value="${backUrl}"/][/@c.url]" method="post">
        </form>
		<br />
	</body>
	</html>
[/#if]